//
//  TipCommentDisplayInfo.m
//  TipsProject
//
//  Created by Suny on 15/6/20.
//  Copyright (c) 2015年 Suny. All rights reserved.
//

#import "TipCommentDisplayInfo.h"
#import "NSDate+BaseFramework.h"
@implementation TipCommentDisplayInfo

- (TipComment *)comment
{
	return (TipComment *)self.modelInfo;
}


- (UIFont *)contentFont
{
    if (!_contentFont)
    {
        _contentFont = [UIFont systemFontOfSize:15];
    }

    return _contentFont;
}

- (NSString *)commentCreateTime
{
	
	NSDate *date = [NSDate dateWithTimeIntervalSince1970:[self.comment.createTime integerValue]/1000];
	return [date commonDateString];
}


- (CGFloat)heightForCell
{
    UILabel *descriptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,
                                                                          0,
                                                                          [UIScreen mainScreen].applicationFrame.size.width - 80,
                                                                          30)];
    descriptionLabel.numberOfLines = 0;
    descriptionLabel.font = self.contentFont;
    [descriptionLabel setText:self.comment.commentContent];
    [descriptionLabel sizeToFit];

    return 80 + (descriptionLabel.height > 30 ? descriptionLabel.height - 30:0);
}
@end
